The present invention relates to a circuit configuration and method for storage management and for execution of user programs in a small control units species of related technology. Small control units are a new type of programmable controller. The wide field of programmable controllers is advantageously expanded by this type of control unit. The user of such a device is capable of implementing the smallest control tasks such as controlling window shutters, lighting systems or the like without having to use a large and expensive programmable controller.
The hardware of traditional programmable controllers is composed essentially of three main parts: a central unit, a memory unit and also peripherals and interface terminals. The central unit executes the corresponding user program by using logic operations, calculations, addressing, etc. The memory contains the user program to be executed and the operating system plus optionally other necessary data. The peripherals and the interfaces provide the central unit with additional operating means such as timer modules, counters and the like as well as connecting means to the outside world (standard interfaces and/or specific interfaces). The memory can be divided into different types according to function.
Code memory for storing the executable code of the operating system. This memory is usually designed as a non-volatile memory in the form of ROM, EPROM, flash or EEPROM and must be read as code by the central unit in the normal function.
Working memory for temporary storage of data during operation of the control unit. Therefore, this memory must be regarded as a read-write memory in the form of RAM.
User program memory for storing the user program. This memory must also be designed as a read-write memory. Furthermore, this memory must be designed as a non-volatile memory or at least as a volatile memory having a buffered power supply in the form of RAM.
For small control units, a microcontroller without the complicated peripherals required with traditional programmable controllers is often sufficient because of the limited variety of functions and the restricted memory space requirement associated with it.
Such circuit configurations are known from the related art in the form of standardized microcontrollers. A microcontroller having a central unit, a ROM unit, a RAM unit and an EEPROM unit is known from the NEC Data Book, xcexc COM-75x family 4-bit CMOS microcomputer DB75XFAM . . . 014V10, page 3-0-265 (see also FIG. 2). Another example of such a microcontroller is known from the Texas Instruments Data Manual, TMS370 family, 1994, SPNS014B, pages 1-15. This microcontroller has a central unit and a combined RAM/EEPROM unit by analogy with the microcontroller diagramed in FIG. 3.
FIG. 1 shows a schematic diagram of the general structure of a prior 2. Such a component consists essentially of a central unit 4 (CPU), an internal memory unit 6, port terminals 8 and also the standard internal peripherals and interface terminals. For the sake of simplicity, the additional standard peripherals and interface terminals are shown in one block as internal peripheral 10. For data exchange, the individual components are interconnected by internal lines 12 (directions of arrows correspond to directions of data flow).
There are a great many variants of microcontrollers in many different designs. Thus, for example, there are microcontrollers having a 4-bit, 8-bit, 16-bit or 32-bit central unit. Furthermore, the components differ greatly with regard to power consumption, speed and internal memory. They also differ greatly with regard to price, depending on the equipment and/or power of the microcontroller.
Since some microcontrollers already have an internal memory and peripherals, use of additional external resources depends on the performance and complexity of the control unit as well as the price and complexity of the microcontroller. In general, it can be assumed that there are suitable microcontrollers containing all the necessary necessary resources for small control units.
FIGS. 2 and 3 show diagrams of different microcontrollers 2 which might be suitable for use in small control units. These prior microcontrollers 2 already have all the resources integrated into them. Thus, microcontroller 2 shown in FIG. 2 has, in addition to central unit 4, a volatile read-write memory part 6a in the form of RAM for temporary storage of processing data, a non-volatile read memory part 6b designed as ROM for storing an interpreter and a non-volatile read-write memory part 6c designed as flash memory or EEPROM or battery-buffered RAM for storing the user program. In FIG. 2 the memory parts in the data area (RAM 6a and EEPROM 6c) and in the code area (ROM 6b) are separated from each other in such a way that the user program can be executed merely by using an interpreter. Microcontroller 2 shown in FIG. 3 is designed like microcontroller 2 shown in FIG. 2, with the difference being that here all memory parts 6a, 6b, 6c are combined in a common code and data area, so that a user program can be compiled (compiler) or interpreted (interpreter) as an alternative.
Such microcontrollers are technically quite suitable for use in small control units. The main disadvantage of such integrated circuit configurations is cost. The more functions implemented in an extremely tight space with integrated circuits, the more expensive is the corresponding chip. Furthermore, the selection of such standardized controllers on the market is greatly limited.
An object of the present invention is to create a sufficiently rapid and high-power circuit configuration for small control units that can be implemented inexpensively and in a small amount of space.
To achieve this object, a circuit configuration having the features of the characterizing part of Claim 1 and different methods according to Claims 4 or 7 are proposed. According to the present invention, the circuit configuration has a microcontroller which includes at least a central unit, a volatile memory in the form of RAM, a non-volatile memory (e.g., ROM) and an interface and has a non-volatile memory in the form of a separate memory unit. The separate memory unit is designed as a serial memory unit, which has the advantage that it is much smaller and less expensive than a parallel memory unit. Any disadvantage with respect to speed is not noticeable in any field of application of such control units when using the method according to the present invention.
In a first method, the external memory unit communicates with the microcontroller over an interrupt-controlled serial interface thereof, and the user program in the external serial memory unit is executed by the central unit and an interpreter in the non-volatile memory of the microcontroller.
In a second method, the external memory unit communicates with the microcontroller either over a serial interface (need not necessarily be interrupt controlled here) or directly over the port pins of the microcontroller. In this method, the central unit copies the total contents of the separate memory unit (the total user program plus the required data) to the internal volatile memory of the microcontroller. Then the central unit interprets the user program exclusively from the internal volatile memory of the microcontroller. This method thus permits a very high processing speed. It is thus possible to implement to advantage an inexpensive circuit configuration which nevertheless meets the requirements that occur with a small control unit with regard to processing speed, functionality and memory space required for the user programs. Such circuit configurations, which are accommodated completely in a microcontroller, are currently approximately twice as expensive.